home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / BounceBack.dxr / 00008_Game Movie.ls < prev    next >
Encoding:
Text File  |  2002-01-31  |  3.8 KB  |  161 lines

  1. global gBallDirection, gLevel, gScore, gBallSpeed, gPaddleHits, gLocH, gLocV, gPause, gFallingBricks, gFallSprite, gDescend, h, v, pMyAngle, gGoBall, gTempTimer, gBoomFrame
  2.  
  3. on prepareMovie
  4.   gGoBall = 0
  5.   gBoomFrame = 1
  6.   sprite(12).locV = 220
  7.   gLocH = 290
  8.   gLocV = 264
  9.   gPause = 0
  10.   sprite(12).visible = 0
  11.   sprite(80).visible = 0
  12.   sprite(82).visible = 1
  13.   gLevel = 1
  14.   member("Level_display_a").text = "Level:" && string(gLevel)
  15.   member("Level_display_b").text = "Level:" && string(gLevel)
  16.   gScore = 0
  17.   member("Score01").text = "Score:" && string(gScore)
  18.   member("Score02").text = "Score:" && string(gScore)
  19.   gBallSpeed = 4
  20.   startTimer()
  21. end
  22.  
  23. on getAngle x1, y1, x2, y2
  24.   loc1 = [x1, y1]
  25.   loc2 = [x2, y2]
  26.   deltaX = loc2[1] - loc1[1]
  27.   deltaY = -1 * (loc2[2] - loc1[2])
  28.   if deltaY = 0 then
  29.     if deltaX > 0 then
  30.       return 0
  31.     end if
  32.     if deltaX < 0 then
  33.       return 180
  34.     end if
  35.   end if
  36.   if deltaX = 0 then
  37.     deltaX = 0.01
  38.   end if
  39.   theAngle = atan(float(deltaY) / float(deltaX))
  40.   theAngle = theAngle * 180 / PI
  41.   if (deltaX < 0) and (deltaY > 0) then
  42.     theAngle = 180 + theAngle
  43.   else
  44.     if (deltaX < 0) and (deltaY < 0) then
  45.       theAngle = 180 + theAngle
  46.     else
  47.       if (deltaX > 0) and (deltaY < 0) then
  48.         theAngle = 360 + theAngle
  49.       end if
  50.     end if
  51.   end if
  52.   theAngle = theAngle - 90
  53.   if theAngle < 0 then
  54.     theAngle = 360 + theAngle
  55.   end if
  56.   return theAngle
  57. end
  58.  
  59. on deathSequence
  60.   puppetSound(6, "kaboom")
  61.   sprite(3).loc = sprite(2).loc
  62.   sprite(3).visible = 1
  63.   gBoomFrame = 1
  64.   repeat with gBoomFrame = 1 to 13
  65.     if gBoomFrame < 10 then
  66.       sprite(3).member = "Explosion" & "0" & gBoomFrame
  67.     else
  68.       sprite(3).member = "Explosion" & gBoomFrame
  69.     end if
  70.     gTempTimer = the timer
  71.     repeat while the timer < (gTempTimer + 4)
  72.       updateStage()
  73.     end repeat
  74.   end repeat
  75.   sprite(3).visible = 0
  76.   gBoomFrame = 1
  77. end
  78.  
  79. on loseALife
  80.   if sprite(14).visible = 1 then
  81.     if (gLevel >= 1) and (gLevel <= 3) then
  82.       sprite(5).locV = 270
  83.       sprite(5).locH = 290
  84.       sprite(4).locH = 290
  85.       sprite(4).locV = 270
  86.       gLocH = 290
  87.       gLocV = 270
  88.     else
  89.       if gLevel = 4 then
  90.         gLocH = 540
  91.         gLocV = 245
  92.         sprite(5).locH = 540
  93.         sprite(5).locV = 245
  94.         sprite(4).locH = 540
  95.         sprite(4).locV = 245
  96.       else
  97.         if gLevel = 5 then
  98.           gLocH = 490
  99.           gLocV = 270
  100.           sprite(5).locH = 490
  101.           sprite(5).locV = 270
  102.           sprite(4).locH = 490
  103.           sprite(4).locV = 270
  104.         end if
  105.       end if
  106.     end if
  107.     gBallDirection = 180.0
  108.     gBallSpeed = 4
  109.     gPaddleHits = 0
  110.     sprite(14).visible = 0
  111.     gGoBall = 0
  112.   else
  113.     if sprite(15).visible = 1 then
  114.       if (gLevel >= 1) and (gLevel <= 3) then
  115.         sprite(5).locV = 270
  116.         sprite(5).locH = 290
  117.         sprite(4).locV = 270
  118.         sprite(4).locH = 290
  119.         gLocH = 290
  120.         gLocV = 270
  121.       else
  122.         if gLevel = 4 then
  123.           gLocH = 540
  124.           gLocV = 245
  125.           sprite(5).locH = 540
  126.           sprite(5).locV = 245
  127.           sprite(4).locH = 540
  128.           sprite(4).locV = 245
  129.         else
  130.           if gLevel = 5 then
  131.             gLocH = 490
  132.             gLocV = 270
  133.             sprite(5).locH = 490
  134.             sprite(5).locV = 270
  135.             sprite(4).locH = 490
  136.             sprite(4).locV = 270
  137.           end if
  138.         end if
  139.       end if
  140.       gBallDirection = 180.0
  141.       gBallSpeed = 4
  142.       gPaddleHits = 0
  143.       sprite(15).visible = 0
  144.       gGoBall = 0
  145.     else
  146.       if sprite(16).visible = 1 then
  147.         sprite(3).locH = sprite(2).locH
  148.         sprite(3).locV = sprite(2).locV
  149.         sprite(3).visible = 1
  150.         sprite(16).visible = 0
  151.         gBallDirection = 180.0
  152.         deathSequence()
  153.         sprite(12).visible = 1
  154.         gGoBall = 0
  155.         cursor(0)
  156.         go(75)
  157.       end if
  158.     end if
  159.   end if
  160. end
  161.